package com.gxa.controller;

import com.gxa.pojo.WechatMeun;
import com.gxa.utils.Constants;
import com.gxa.utils.ResponseData;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * User: tx
 * Date: 2020/11/26 17:01
 * Description:
 * Version: V1.0
 */
@RestController
@Api(value = "微信自定义菜单",tags = "微信自定义菜单")
@RequestMapping(value = "options")
public class WechatMenuController {

    @Autowired
    private ResponseData responseData;
    @Autowired(required = false)
    private Constants constants;

    @PostMapping("/addWechatMenu")
    @ApiOperation(value = "添加微信自定义菜单",notes = "根据提交的信息添加微信自定义菜单",httpMethod = "POST",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "添加成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "添加失败")
    })
    public ResponseData addWechatMenu(@RequestBody @ApiParam(name = "wechatMeun",value = "微信自定义菜单",required = true) WechatMeun wechatMeun){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("添加成功");
        responseData.setData(wechatMeun);
        return responseData;
    }



    @GetMapping("/delWechatMenu")
    @ApiOperation(value = "删除微信自定义菜单",notes = "根据提交的信息删除微信自定义菜单",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "删除成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "删除失败")
    })
    public ResponseData delWechatMenu(@ApiParam(name = "dasId",value = "微信自定义菜单id",required = true) int wechatMid){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("删除成功");
        responseData.setData(wechatMid);
        return responseData;
    }




    @GetMapping("/updateWechatMenu")
    @ApiOperation(value = "修改微信自定义菜单",notes = "根据提交的信息修改微信自定义菜单",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "修改成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "修改失败")
    })
    public ResponseData updateWechatMenu(@ApiParam(name = "modId",value = "微信自定义菜单id",required = true) int wechatMid){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("修改成功");
        responseData.setData(wechatMid);
        return responseData;
    }



    @PostMapping("/queryWechatMenu")
    @ApiOperation(value = "查询微信自定义菜单",notes = "根据提交的信息查询微信自定义菜单",httpMethod = "POST",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "查询失败")
    })
    public ResponseData queryWechatMenu(@ApiParam(name = "wechatMeun",value = "微信自定义菜单",required = true) WechatMeun wechatMeun){
        wechatMeun.setWechatMname("菜单名1");
        wechatMeun.setWechatAo(1);
        wechatMeun.setWechatRaction("快");
        wechatMeun.setWechatTaction("开始");
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(wechatMeun);
        return responseData;
    }
}
